<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
      // 得到类型名称
      console.log({}.toString())
      console.log({a: 1}.toString())
      console.log([1, 2].toString())  // 1,2
      console.log(new Date().toString())  // [object Date]
      console.log(Object.prototype.toString.call([]).slice(8, -1))  // [object Array]

  </script>
</body>
</html>